<?php
namespace app\home\validate;
use think\Validate;
class Seller extends Validate
{
    protected $rule = [
    'seller_name'  => 'require|min:2',
    'seller_rname' => 'require|min:2',
    'seller_idcard'=> 'require|length:18',
    'examine_img'  => 'require',
    'seller_tell'  => 'require|length:11|unique:seller,seller_tell',
    'seller_local' => 'require|min:6',
    'seller_email' => 'require|email',
    'seller_pwd'   => 'require|min:6',
    'seller_repwd' => 'require|confirm:seller_pwd'
    ];

    protected $message = [
    'seller_name.require'  => '商家用户名必须填写',
    'seller_rname.require' => '商家负责人真实姓名必须填写',
    'seller_idcard.require'=> '身份证号码必须填写',
    'seller_local.require' => '商家地址必须填写',
    'seller_tell.require'  => '商家电话号码必须填写',
    'examine_img.require'  => '审核相片必须上传',
    'seller_email.require' => '商家邮箱必须填写',
    'seller_pwd.require'   => '密码必须填写',
    'seller_repwd.require' => '确认密码必须填写',

    'seller_tell.unique'   => '该商家电话号码已被注册',  
    'seller_name.min'      => '商家用户名长度不能少于2位',
    'seller_rname.min'     => '真实姓名长度不能少于2位',
    'seller_idcard.length' => '身份证号码必须18位',
    'seller_local.min'     => '商家地址长度不能少于6位',
    'seller_tell.length'   => '商家电话号码必须11位',
    'seller_email.email'   => '该邮箱为非法邮箱',
    'seller_pwd.min'       => '密码长度不能少于6位',
    'seller_repwd.confirm' => '两个密码输入必须一致'
	];
}
?>